package com.example.controller;

import com.example.entity.Dept;
import com.example.entity.R;
import com.example.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xiaozhang
 * @since 2024-10-17 09:24
 */
@RestController

@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private IDeptService DeptService;



    //查看所有数据
    @GetMapping("/list")
    public R list(){
        List<Dept> list = DeptService.list();
        return R.data(list);
    }


}
